<?php
/**
 * @version      BOSSCMS-Free
 * @trademark    BOSSCMS
 * @copyright    Copyright © by BOSSCMS-Free (https://www.bosscms.net/) 保留所有权利
 * @license      https://gitee.com/Greenpeas/BOSSCMS/license/ 和 https://www.bosscms.net/freelicense/
 * @link         https://www.bosscms.net/
 * @author       温州软界网络技术有限公司
**/
defined('IS_OK') or exit('Access Forbidden');

into::basic_class('origin');

class notice extends origin
{
	public function get()
	{
		global $G;
		if(isset($G['post'])){
			$type = $G['post']['type'];
			$id = $G['post']['id'];
			if(preg_match('/^(2|3|4|5)$/',$type)){
				/* B O S S C M S */
				$table = array_search($type,$G['pass']['type']);
				$res = mysql::select_one('notice',$table,"id='{$id}'");
				$notice = $res['notice']+1;
				mysql::update(array('notice'=>$notice),$table,"id='{$id}'");
				echo json::encode(array('notice'=>$notice,'type'=>$type,'id'=>$id));
			}
		}
	}
}
?>